from tkinter import *

print('Введите начальную координату X:')
koor1 = int(input())
print('Введите начальную координату Y:')
koor2 = int(input())
print('Введите коэффициент увеличения N:')
ras = int(input())

coords = [0,0,10,0,10,10,20,10,20,20,10,20,10,30,0,30]

if ras == 0 and koor1>=0 and koor1<=500 and koor2>=0 and koor2<=500:
    pass
else:
    if ras > 0 and 0*ras+koor1>=0 and 0*ras+koor2>=0 and 20*ras+koor1<=500 and 20*ras+koor2<=500:
        pass
    else:
        if ras < 0 and 20*ras+koor1>=0 and 20*ras+koor2>=0 and 0*ras+koor1<=500 and 0*ras+koor2<=500:
            pass
        else:
            print('Размер фигуры превышает максимальный размер поля')
            exit()

root = Tk()
root.title("ИТ марафон")
root.geometry("500x500")

canvas = Canvas(bg="#ff0", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

canvas.create_polygon(coords[0] *ras+koor1, coords[1] *ras+koor2,
                      coords[2] *ras+koor1, coords[3] *ras+koor2,
                      coords[4] *ras+koor1, coords[5] *ras+koor2,
                      coords[6] *ras+koor1, coords[7] *ras+koor2,
                      coords[8] *ras+koor1, coords[9] *ras+koor2,
                      coords[10]*ras+koor1, coords[11]*ras+koor2,
                      coords[12] *ras+koor1, coords[13] *ras+koor2,
                      coords[14]*ras+koor1, coords[15]*ras+koor2)

root.mainloop()
